//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.goldhuman.IO.Protocol;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

public final class State {
    private static final Map<String, State> map = new HashMap();
    private Set<String> set = new HashSet();
    private long timeout;

    static {
        try {
            Parser.ParseState(map);
        } catch (Exception var1) {
            var1.printStackTrace();
        }

    }

    protected State(long t) {
        this.timeout = t;
    }

    protected State(State _s) {
        try {
            this.set = (HashSet)((HashSet)_s.set).clone();
        } catch (Exception var3) {
            var3.printStackTrace();
            System.out.println("in state");
            System.exit(0);
        }

        this.timeout = _s.timeout;
    }

    protected void AddProtocolType(String type) {
        this.set.add(type);
    }

    protected boolean TypePolicy(int type) {
        return this.set.contains(Integer.toString(type));
    }

    protected boolean TimePolicy(long t) {
        return this.timeout < 0L || t < this.timeout;
    }

    public static State Get(String name) {
        return (State)map.get(name.toUpperCase());
    }
}
